import http from '../utils/request'

// 获取日报列表
export function getDailyReports(params = {}) {
  return http({
    url: '/api/daily-reports',
    method: 'get',
    params
  })
}

// 获取日报详情
export function getDailyReportDetail(id) {
  return http({
    url: `/api/daily-reports/${id}`,
    method: 'get',
  })
}

// 创建日报
export function createDailyReport(data) {
  return http({
    url: '/api/daily-reports',
    method: 'post',
    data
  })
}

// 更新日报
export function updateDailyReport(id, data) {
  return http({
    url: `/api/daily-reports/${id}`,
    method: 'put',
    data
  })
}

// 保存日报草稿
export function saveDailyReportDraft(id, data) {
  return http({
    url: `/api/daily-reports/${id}/draft`,
    method: 'post',
    data
  })
}

// 获取日报提交状态
export function getDailyReportStatus(params = {}) {
  return http({
    url: '/api/daily-reports/status',
    method: 'get',
    params
  })
}